package net.danielthompson.danray.cameras.apertures;

import net.danielthompson.danray.structures.Point;

/**
 * Created by daniel on 3/4/14.
 */
public class CircleAperture implements Aperture {

   double _size;

   public CircleAperture(double size) {
      _size = size;
   }

   @Override
   public Point GetOriginPoint() {
      double x = Math.random() - .5;

      double yFactor = Math.sqrt(1 - x * x);

      x *= _size;

      double y = (Math.random() - .5) * _size * yFactor;

      double z = 0.0f;

      return new Point(x, y, z);
   }
}
